package Example4.Example30;

import java.util.zip.DataFormatException;

public class Example30 {
    public static void main(String[] args) throws DivdeByMinusException {
        int result = divide(4,-2);
        System.out.println(result);
    }


    public static int divide(int x, int y) throws DivdeByMinusException {
        if (y<0){
            throw new DivdeByMinusException("除数是负数");}
            int result = x/y;
        return result;
        }
    }

